class Solution {
public:
    long long countCompleteDayPairs(vector<int>& hours) {

        int n = hours.size();

        sort(hours.begin(), hours.end());

        map<long long, long long> mymap;

        long long cnt1 = 0;
        for (int i = 0; i < n; i++)
            if (hours[i] % 24 == 0)
                cnt1++;
            else
                mymap[hours[i] % 24]++;

        long long ans = (cnt1) * (cnt1 - 1) / 2;

        for (auto x : mymap)
        {
            long long  val = x.first, count = x.second;

            if (val == 12)
            {
                if (count >= 2)
                    // ans += count - 1;
                    ans += (count) * (count - 1) / 2;
            }
            else
            {
                // cout << "ans : " << ans << endl;
                if (mymap[24 - val])
                {
                    ans = ans + (mymap[24 - val]) * count;
                    mymap[val] = 0;
                    cout << "mymap[val] : " << mymap[val] << endl;
                }

            }
            cout << "ans : " << ans << endl;
        }

        return ans;

    }
};